package com.web44.springboot;

import com.web44.springboot.bean.Emp03;
// import com.web44.start.anno.MyEnableStart;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.ImportResource;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

// scanBasePackages 指定扫描哪些包
//
@SpringBootApplication // SpringBootApplication 扫描当前类所在的文件夹下所有的内容
// @EnableConfigurationProperties(Emp03.class)  // 本质 就是import
@Import(Emp03.class)
// 引入外部xml
@ImportResource("classpath:config/beans.xml")
// @MyEnableStart
@MapperScan("com.web44.springboot.mapper")  // 开启mapper的包扫描机制
// 开启事务注解
@EnableTransactionManagement
// 开启异步功能
@EnableAsync
// 开启任务调度
@EnableScheduling

public class SpringbootDemoApplication {

    public static void main(String[] args) {
        // 启动
        // ConfigurableApplicationContext context= SpringApplication.run(SpringbootDemoApplication.class, args);
//        String[] beanDefinitionNames = context.getBeanDefinitionNames();
//        for (String name  :beanDefinitionNames) {
//            System.out.println(name);
//        }
        // 关闭banner
        SpringApplication springApplication = new SpringApplication(SpringbootDemoApplication.class);
        // springApplication.setBannerMode(Banner.Mode.OFF);
        springApplication.run(args);
    }

}
